package org.example.springboot.controller;

import org.example.springboot.annotations.MappingCombine;
import org.example.springboot.entities.Articles;
import org.example.springboot.response.PaginationResponse;
import org.example.springboot.service.ArticleService;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@MappingCombine("/article")
public class ArticleController extends BaseController<ArticleService, Articles> {

  @Override
  public PaginationResponse<List<Articles>> queryAllPagination(@PathVariable Integer pageNumber) {
    return baseService.getArticles(pageNumber);
  }

  @Override
  public Articles queryById(Integer id) {
    return baseService.getArticleById(id);
  }

  @Override
  public List<Articles> queryAll() {
    return baseService.getArticles();
  }
}
